<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * detail.php
 * @author ranuandra
 *
 * 28 Mei 2012 08:19:47
 *
 * 
 */
?>
<h1><?php echo $data->deskripsi?> ( <?php echo $data->kode?> )</h1>
<table cellpadding="12" cellspacing="0">
	<tr>
		<td>Jabatan</td>
		<td><?php echo $data->mstjabatan->jabatan?></td>
	</tr>
	<tr>
		<td>Kualifikasi Umum</td>
		<td><?php echo $data->kualifikasi_umum ?></td>
	</tr>
	<tr>
		<td>Kualifikasi Khusus</td>
		<td><?php echo $data->kualifikasi_khusus ?></td>
	</tr>
	<tr>
		<td>Tanggal Publikasi</td>
		<td><?php echo date("d M Y", strtotime( $data->publisheddate ) ) ?></td>
	</tr>
	<tr>
		<td>Tanggal Tayang</td>
		<td><?php echo date("d M Y", strtotime( $data->datefrom ) ) ?> - <?php echo date("d M Y", strtotime( $data->dateto ) ) ?></td>
	</tr>
</table>
<h3>Proses</h3>
<table class="data">
	<thead>
	<tr>
		<th>Proses</th>
		<th>Tanggal Proses</th>
		<th>Jumlah</th>
		<th>Hadir</th>
		<th>Lolos</th>
	</tr>
	</thead>
	<tbody>
<?php 
	$pendaftar = $data->pelamarlowongan;
	
?>
	<tr>
		<td>Pendaftaran</td>
		<td><?php echo date("d M Y", strtotime($data->dateto))?></td>
		<td><?php echo $pendaftar->count_all()?></td>
		<td></td>
		<td><?php echo $pendaftar->where('flag_panggil', '=', 1)->count_all()?></td>
	</tr>
<?php 
	foreach($proseses as $proses)
	{
		$proseslowongan = $data->proseslowongan->where('mstproses_id', '=', $proses->id)->find();
		?>
		<tr>
			<td><?php echo $proses->proses?></td>
			<td><?php 
					if($proseslowongan->tanggal != "")
					{
						echo date("d M Y", strtotime($proseslowongan->tanggal));
					}
					else 
					{
						echo "-";
					}
					?>
			</td>
			<td>
			<?php 
				if($proseslowongan->pelamarproses->count_all() > 0)
				{
					echo $proseslowongan->pelamarproses->count_all();
				}
				else 
				{
					echo "-";	
				}
			?>
			</td>
			<td>
			<?php 
				if($proseslowongan->pelamarproses->where('flag_hadir', '=', 1)->count_all() > 0)
				{
					echo $proseslowongan->pelamarproses->where('flag_hadir', '=', 1)->count_all();
				}
				else 
				{
					echo "-";	
				}
			?>
			</td>
			<td>
			<?php 
				if($proseslowongan->pelamarproses->where('flaglolos', '=', 1)->count_all() > 0)
				{
					echo $proseslowongan->pelamarproses->where('flaglolos', '=', 1)->count_all();
				}
				else 
				{
					echo "-";	
				}
			?>
			</td>
		</tr>
		<?php 
	}
	
?>
		</tbody>
</table>